home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / os2 / gnuwget.zip / wget-1.4.3 / src / utils.h < prev    next >
C/C++ Source or Header  |  1997-01-27  |  3KB  |  85 lines

  1. /* Declarations for utilities.
  2.    Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
  3.    
  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 2 of the License, or
  7.    (at your option) any later version.
  8.    
  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.
  13.    
  14.    You should have received a copy of the GNU General Public License
  15.    along with this program; if not, write to the Free Software
  16.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  17.  
  18.  
  19. #ifndef UTILS_H
  20. #define UTILS_H
  21.  
  22. #include "cmpt.h"
  23.  
  24. /* The size of the initial buffer for read_whole_line. */
  25. #define DYNAMIC_LINE_BUFFER 40
  26. /* Separator for legible numbers */
  27. #define LEGIBLE_SEPARATOR ','
  28. /* Is the string a hpyhen-only? */
  29. #define ISHYPHEN(x) (*(x) == '-' && !*((x) + 1))
  30. /* Buffer for file-loading */
  31. #define FILE_BUFFER_SIZE 512
  32.  
  33. /* Flags for slist.  */
  34. enum {
  35.    NOSORT     = 1
  36. };
  37.  
  38. enum accd {
  39.    ALLABS = 1
  40. };
  41.  
  42. /* A linked list of strings. The list is ordered alphabetically. */
  43. typedef struct _slist {
  44.    char *string;
  45.    struct _slist *next;
  46. } slist;
  47.  
  48. void *nmalloc PARAMS((size_t));
  49. void *nrealloc PARAMS((void *, size_t));
  50. char *nstrdup PARAMS((const char *));
  51. void memfatal PARAMS((const char *));
  52. const char *uerrmsg PARAMS((uerr_t));
  53.  
  54. char *strdupdelim PARAMS((const char *, const char *));
  55. char **sepstring PARAMS((const char *));
  56. int frontcmp PARAMS((const char *, const char *));
  57. char *mycuserid PARAMS((char *));
  58. void path_simplify PARAMS((char *));
  59.  
  60. int remove_link PARAMS((const char *));
  61. int exists PARAMS((const char *));
  62. int isfile PARAMS((const char *));
  63. int mymkdir PARAMS((const char *));
  64.  
  65. int acceptable PARAMS((const char *));
  66. int accdir PARAMS((const char *s, enum accd));
  67. int match_backwards PARAMS((const char *, const char *));
  68. int in_acclist PARAMS((const char **, const char *, int));
  69. char *suffix PARAMS((const char *s));
  70.  
  71. char *read_whole_line PARAMS((FILE *));
  72. void load_file PARAMS((FILE *, char **, long *));
  73.  
  74. void free_vec PARAMS((char **));
  75. char **merge_vecs PARAMS((char **, char **));
  76. slist *add_slist PARAMS((slist *, const char *, int));
  77. int in_slist PARAMS((slist *, const char *));
  78. void free_slist PARAMS((slist *));
  79.  
  80. char *legible PARAMS((long));
  81. int numdigit PARAMS((long));
  82. void prnum PARAMS((char *, long));
  83.  
  84. #endif /* UTILS_H */
  85.